        //
//  BaseViewController.m
//  FoodList
//
//  Created by 王金晶 on 16/4/6.
//  Copyright © 2016年 王金晶. All rights reserved.
//

#import "BaseViewController.h"
#import "TabbarViewController.h"
@interface BaseViewController ()
@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.translucent = NO;

    UIBarButtonItem *left = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"19-gear"] style:UIBarButtonItemStylePlain target:self action:@selector(leftBarButtonAction:)];
    self.navigationItem.leftBarButtonItem = left;
    
//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(delegateAction)];
//    [self.view addGestureRecognizer:tap];
    
    UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(leftBarButtonAction:)];
    swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
    [self.view addGestureRecognizer:swipeRight];
}
- (void)leftBarButtonAction:(UISwipeGestureRecognizer *)swipe
{
    if (_delegate && [_delegate respondsToSelector:@selector(changerightFrame)]) {
       [self.delegate changerightFrame];
    }
}
//- (void)delegateAction
//{
//    if (_delegate && [_delegate respondsToSelector:@selector(tapAction:)]) {
//        [_delegate tapAction:nil];
//    }
//}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
